package com.upcoming.common;

import java.io.Serializable;
import java.util.UUID;

/**
 * 作者：tianjiayuan
 * 创建时间：2018-05-10 10:38
 * 类描述：
 * 修改人：
 * 修改时间：
 */
public abstract class Token implements Serializable {

    private static final long serialVersionUID = 5886987116773139712L;

    private long issueTime;//发型时间
    private long expires;//到期时间，时间戳
    private String issuer;//发型者
    private String signature;//签名

    /**
     * 将Token转为base64编码格式
     *
     * @return
     */
    public abstract String toBase64Encode();

    protected static String getUniqueID() {
        return UUID.randomUUID().toString().replaceAll("-", "");
    }

    public String getIssuer() {
        return issuer;
    }

    public void setIssuer(String issuer) {
        this.issuer = issuer;
    }

    public long getIssueTime() {
        return issueTime;
    }

    public void setIssueTime(long issueTime) {
        this.issueTime = issueTime;
    }

    public String getSignature() {
        return signature;
    }

    public void setSignature(String signature) {
        this.signature = signature;
    }

    public long getExpires() {
        return expires;
    }

    public void setExpires(long expires) {
        this.expires = expires;
    }



}
